package com.java.lesson.lesson2;

public class Lesson29_ {
    public static void main(String[] args) {
        int AB = 0;
        int CD = 0;
        int DA=0;
        for (int A = 0; A <= 9; A++) {
            for (int B = 0; B <= 9; B++) {
                AB = A * 10 + B;
                for (int C = 0; C <= 9; C++) {
                    for (int D = 0; D <= 9; D++) {
                        CD = C * 10 + D;
                        DA=D*10+A;
                        if (AB+CD==DA) {
                            System.out.println(A + "" + B + "+" + C + "" + D + "=" + D + "" + A);
                        }
                    }
                }
            }
        }
    }
}
